package com.ruoyi.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MineLtcdjc extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long id;
    //测点编码
    private String stationCoding;
    //测点名称
    private String stationName;

    //系统编码
    private String systemCoding;

    //矿山编码
    private String mineCoding;
    //边坡编码
    private String sideCoding;
    //传感器类型
    private String transducer;
    // 测点数据类型
    private String stationType;
    //测点数据单位
    private String stationUnit;
    //埋深
    private BigDecimal burialDepth;
    // 阈值1
    private String thresholdOne;
    // 阈值2
    private String thresholdTwo;
    // 阈值3
    private String thresholdThree;
    // 阈值4
    private String thresholdFour;
    //安装地址
    private String location;
    //经度
    private BigDecimal longitude;
    //纬度
    private BigDecimal latitude;
    //高程
    private BigDecimal elevation;
    //安装日期
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDateTime installationDate;
    // 生产厂家
    private String manufacturer;
    //量程
    private String stationRange;
    //再用状态
    private Byte reuseState;
    //故障状态
    private Byte malfunction;

    //上传时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime detectedTime;


    @Override
    public String toString() {
        return
                stationCoding + ';' +
                        stationName + ';' +
                        systemCoding + ';' +
                        mineCoding + ';' +
                        sideCoding + ';' +
                        transducer + ';' +
                        stationType + ';' +
                        stationUnit + ';' +
                        burialDepth + ';' +
                        thresholdOne + ';' +
                        thresholdTwo + ';' +
                        thresholdThree + ';' +
                        thresholdFour + ';' +
                        location + ';' +
                        longitude + ';' +
                        latitude + ';' +
                        elevation + ';' +
                        installationDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + ';' +
                        manufacturer + ';' +
                        stationRange + ';' +
                        reuseState + ';' +
                        malfunction + ';' +
                        detectedTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));

    }
}
